#include "StdAfx.h"
#include "asy_queue_processor.h"
#include "http_client.h"

asy_queue_processor::asy_queue_processor(void)
{
}

asy_queue_processor::~asy_queue_processor(void)
{
}

void 
asy_queue_processor::LoopProc(_AFT::isession** pMsgPack, PWORKER_PARAMETER work_para)
{
	_AFT::isession* ptr_session = *pMsgPack;
	if ( ptr_session->get_type() == _AFT::isession::e_upload_file )
	{
		http_client client;
		http_client::session_setting setting;
		setting.ptr_notify = ptr_session->get_notify();
		setting.ptr_session = ptr_session;
		client.post_file(setting);
	}
	else if ( ptr_session->get_type() == _AFT::isession::e_download_file )
	{
		http_client client;
		http_client::session_setting setting;
		setting.ptr_notify = ptr_session->get_notify();
		setting.ptr_session = ptr_session;
		client.download_file(setting);
	}

}
